package com.acoffee.controller;

import com.acoffee.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.validation.Valid;

/**
 * @author acoffee
 * @create 2021-11-20 18:04
 */
@Controller
@RequestMapping("/acoffee")
public class UserController {
    @RequestMapping("/ObjectView")
    public ModelAndView andView3(@Valid User user, BindingResult bindingResult){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("user","传入的参数是："+user.toString());

        modelAndView.setViewName("objectView");
        return modelAndView;
    }
}
